<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>你好！欢迎登录</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body style="text-align: center;background-image: url('../static/src/loginbkg.jpg');background-size: 100% 100%;
    background-repeat:no-repeat;
    background-attachment: fixed;">
{% if loginflag == 'regist_sucsess' %}
    <script type="text/javascript">
        alert("注册成功")
    </script>
{% endif %}
{% if wrong == 1 %}
<script type="text/javascript">
        alert("用户名或密码错误")
</script>
{% endif %}

<div style="margin-top: 20%;"></div>
<div style=" opacity:0.8; background-color:#fff;min-width: 230px;width: 33%;border:10px;border-radius:10px;margin-left: auto;margin-right: auto;">
    <span><font size="5">欢迎使用智能分诊系统！</font></span>
    <br>
    <br>
    <form name="LoginForm" method="POST" action="/loginf/" enctype="multipart/form-data" onsubmit="return validForm()">
        {% csrf_token %}
        <div style="position: relative;">
            <div style="">
                <div style="position:relative">
                    <font size="4" color="#000000">账号</font>&nbsp;
                    <input id="username" type="text" name="username" width="25%" maxlength="26" autocomplete="off"
                           value="{{ loginnum }}"/>
                    <br>
                    <br>
                    <font size="4" color="#000000">密码</font>&nbsp;
                    <input id="password" type="password" name="pwd" width="25%" maxlength="16"/>
                </div>
                <br>
                <div style="height:40px;line-height:40px;clear:both;position:relative;">
                    <input type="checkbox" name="savezhmm" value="0"
                           style="vertical-align:middle; margin-top:-2px; margin-bottom:1px;"/><span
                        style="font-size:12px;">记住用户名及密码</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

                    <button class="btn btn-success" type="submit" id="loginsubmit">登录</button>
                    &nbsp;&nbsp;
                    <input type="button" name="regist" class="btn btn-primary" value="注册"
                           onclick="window.location.href='/regist/'"/>&nbsp;&nbsp;
{#                    <input type="button" name="password_reset" class="btn btn-default" value="找回密码"#}
{#                           onclick="window.location.href='/mysite/password_reset/'"/>#}
                </div>
                <br>
            </div>
        </div>
    </form>
    <script>
        $(document).ready(function () {
            $("input[type='submit']").click(function validForm() {
                if ($("input[type='text']").val() == "") {
                    alert("请输入账号");
                    return false;
                } else if ($("input[type='password']").val() == "") {
                    alert("请输入密码");
                    return false;
                } else {
                    return true;
                }
            });
        });
    </script>
</div>

</body>
</html>